package com.hp.ssm.service;

import com.hp.ssm.bean.Doctor;
import com.hp.ssm.bean.DoctorExample;
import com.hp.ssm.mapper.DoctorMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DoctorServiceImp implements DoctorService {
    @Resource
    private DoctorMapper doctorMapper;
    @Override
    public Doctor login(DoctorExample example) {
        List<Doctor> list = doctorMapper.selectByExample(example);
        if(list.size()>0){
           return list.get(0);
        }
        return null;
    }

    @Override
    public int add(Doctor doctor) {
        return doctorMapper.insert(doctor);
    }
}
